<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <script src="../common/vue.min.js" type="text/javascript"></script>
    <style type="text/css">

    </style>
</head>
<body>
<!--view-->
<div id="e2">

    <div v-bind:class="[ classA, classB ]">
        cssDataArr
    </div>

    <div v-bind:class="[ classA,cssData2.isA?classB:'' ]">只有classA
        cssDataArr22222
    </div>

    <div v-bind:class="[ classA,cssData2.isA,cssData2.isB ]"> 只有classA
        cssDataArr3333
    </div>

</div>


<script type="text/javascript">


    /**
     *
     */
    var vm = new Vue({
        el: '#e2', //el :element
        data: {
            a: true,
            raw_html: "<span style='color: red'><b>你好啊</b></span>",
            b: "1",
            c: 1,
            d: 2,
            e: "reese",
            url: "http://www.baidu.com",
            cssData1: {
                'class-a': true,
                'class-b': false
            },
            cssData2: {
                isA: false,
                isB: true
            },
            cssDataArray: {
                classA: "class-a",
                classB: "class-b"
            },
            classA: "classA",
            classB: "classB"
        },
        //TODO 钩子是什么
        //vm实例创建后的钩子
        created: function () {
            console.log(this);//vm实例
            console.log("a1:" + this.a);
            console.log("a2:" + this.$data.a);
            console.log(this.a == this.$data.a);
        }
    })
    //    vm.$data.a = false;

    console.log("--------------------------")
    console.log(vm.$data.classA)
    console.log(vm.classA)
    console.log(vm.cssDataArray.classA)
    console.log(vm.isA)//undefined


    //TODO 点击后不执行
    function doSomething() {
        alert(1);
        alert(vm.$data.url);
    }


</script>

</body>
</html>